package com.wxb.boot.nacos.consumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * describe:
 *
 * @author : wxbing
 * @date : 2021/3/26
 */
@RestController
public class NacosConsumer {

	@Autowired
	private RestTemplate restTemplate;

	@GetMapping("/echo/{str}")
	public String echo(@PathVariable String str) {
		return restTemplate.getForObject("http://nacos-provider/echo/" + str, String.class);
	}
	
}

